#region Using References

using System;
using System.Diagnostics.Contracts;
using Beaker.OpenCube.Nbt;

#endregion

namespace Beaker.OpenCube.Mapping
{
	[Pure]
	public class MappingAttribute
		: Attribute
	{
		/// <summary>
		/// Gets or sets the name to map to, if it differs from the name of the property.
		/// </summary>
		/// <value>
		/// The name to map to.
		/// </value>
		public string Name { get; set; }


		/// <summary>
		/// Gets or sets the a sequence of names to map to, using a converter to convert.
		/// </summary>
		/// <value>
		/// The names to map to.
		/// </value>
		public string[] Names { get; set; }
		
		/// <summary>
		/// Gets or sets the tag to map to, if different from the default mapping based on type.
		/// </summary>
		/// <value>
		/// The tag to map to.
		/// </value>
		public NbtTag Tag { get; set; }

		/// <summary>
		/// Gets or sets the tag of the items in the list.
		/// </summary>
		/// <value>
		/// The tag of the items in the list.
		/// </value>
		public NbtTag ListTag { get; set; }

		/// <summary>
		/// Gets or sets the fixed size of the list.
		/// </summary>
		/// <value>
		/// The fixed size of the list.
		/// </value>
		public int ListFixedSize { get; set; }

		/// <summary>
		/// Gets or sets a value indicating whether this property is optional.
		/// </summary>
		/// <value>
		/// <c>true</c> if this property is optional; otherwise, <c>false</c>.
		/// </value>
		public bool IsOptional { get; set; }
		
		/// <summary>
		/// Gets or sets a value indicating whether this property should be skipped.
		/// </summary>
		/// <value>
		///   <c>true</c> if this property should be skipped; otherwise, <c>false</c>.
		/// </value>
		/// <remarks>
		/// The difference with <see cref="IsOptional"/> that this CAN NEVER occure in the file, while IsOptional CAN, but is OPTIONAL.
		/// </remarks>
		public bool Skip { get; set; }


		/// <summary>
		/// Gets or sets the optional converter to convert from and to a NBT value.
		/// </summary>
		/// <value>
		/// The optional convert to convert from and to a NBT value.
		/// </value>
		public Type Converter { get; set; }

		/// <summary>
		/// Gets or sets if the property should be ignore during mapping
		/// </summary>
		/// <value>
		///   <c>true</c> if this property should be ignored during mapping; otherwise, <c>false</c>.
		/// </value>
		public bool Ignore { get; set; }
	}
}